<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Query\Builder;

class Product extends Model
{
    public function shops()
    {
        $this->belongsToMany(Shop::class)
           ;
    }

    /**
     * @param Builder $query
     * @return mixed
     */
    public function scopeExpensive($query)
    {
        return $query->where('price', '>', '25');
    }
}
